import tcdIO.*;

		class CandidateApp {
			
			public static void main(String args[]){
			
			Terminal terminal1;
			Candidate[] candidates;
			float totalvotes;
			
			
			terminal1 = new Terminal();
			
			totalvotes = 0;
			
			candidates = new Candidate[terminal1.readInt("Enter number of candidates: ")];
			
			for(int i = 0; i <= candidates.length - 1; i++){
			
			candidates[i] = new Candidate(terminal1.readString("Enter candidate " + (i + 1) + " name: "), terminal1.readInt("Enter Votes: "));
			totalvotes = candidates[i].getVotes() + totalvotes;
			}
			
			for(int i = 0; i <= candidates.length - 1; i++){
				candidates[i].setPercentage((candidates[i].getVotes() / totalvotes) * 100);
				terminal1.println(candidates[i].getDetails());
			}
			
			}

}
